package com.tx.admin.util.web;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;


public class SessionUtil extends SecurityUtils {

	public static void set(Object key,Object val) {
	 	Session session=getSubject().getSession();
    	session.setAttribute(key, val);
	}
	
	
    public static <T> T get(Object key) {
    	Session session=getSubject().getSession();
    	return (T) session.getAttribute(key);
    } 
    
    public static String getId() {
    	Session session=getSubject().getSession();
    	return session.getId().toString();
    } 
}
